/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseResponseBoolean } from "../models/BaseResponseBoolean";
import type { BaseResponsePageQuestionCase } from "../models/BaseResponsePageQuestionCase";
import type { DeleteRequest } from "../models/DeleteRequest";
import type { QuestionCaseAddRequest } from "../models/QuestionCaseAddRequest";
import type { QuestionCaseEditRequest } from "../models/QuestionCaseEditRequest";
import type { QuestionCaseQueryRequest } from "../models/QuestionCaseQueryRequest";

import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";
import type { BaseResponseQuestion } from "../models/BaseResponseQuestion";
import { BaseResponseQuestionCase } from "../models/BaseResponseQuestionCase";

export class QuestionCaseControllerService {
  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static updateQuestionCase(
    requestBody: QuestionCaseEditRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "PUT",
      url: "/question_case",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static deleteQuestionCase(
    requestBody: DeleteRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "DELETE",
      url: "/question_case",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static addQuestionCase(
    requestBody: QuestionCaseAddRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question_case/add",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @returns BaseResponsePageQuestionCase OK
   * @throws ApiError
   * @param requestBody
   */
  public static pageQueryQuestionCase(
    requestBody: QuestionCaseQueryRequest
  ): CancelablePromise<BaseResponsePageQuestionCase> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question_case/page",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param id
   * @returns BaseResponseQuestionCase OK
   * @throws ApiError
   */
  public static getQuestionCase(
    id: number
  ): CancelablePromise<BaseResponseQuestionCase> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/question_case/get",
      query: {
        id: id,
      },
    });
  }
}
